package com.medicinemanager.app;

import java.io.File;
import java.util.ArrayList;
import java.util.List;

import com.medicinemanager.bean.Entity;
import com.medicinemanager.bean.Staff;
import com.medicinemanager.util.Configure;

import android.app.Application;

public class MedicineApp extends Application{
	private Configure mConfigure = null;
	private Staff mStaff = null;
	private ArrayList<Entity> mStaffs = null;
	private ArrayList<Entity> mMedicines = null;
	/**
	 * init
	 */
	public void onCreate(){
		super.onCreate();
		mConfigure = Configure.getInstance();
		checkFile();
	}
	/**
	 * init check file exist
	 */
	private void checkFile(){
		File file = new File(mConfigure.FILEPATH + File.separator + mConfigure.FILENAME);
		if(!file.exists()){
			file.mkdirs();
		}
	}
	
	public void setStaff(Staff staff){
		mStaff = staff;
	}
	
	public Staff getStaff(){
		return mStaff;
	}
	
	public void setStaffs(ArrayList<Entity> arrayList){
		mStaffs = arrayList;
	}
	
	public List<Entity> getStaffs(){
		return mStaffs;
	}
	
	public void setMedicines(ArrayList<Entity> arrayList){
		mMedicines = arrayList;
	}
	
	public ArrayList<Entity> getMedicines(){
		return mMedicines;
	}
}
